# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=yices2
pkgver=2.6.4
pkgrel=0
pkgdesc="Solver for Satisfiability Modulo Theories (SMT) problems"
url="https://github.com/SRI-CSL/yices2"
arch="all"
license="GPL-3.0-or-later"
makedepends="autoconf automake gperf gmp-dev"
checkdepends="bash"
subpackages="$pkgname-dev $pkgname-libs"
source="https://github.com/SRI-CSL/yices2/archive/refs/tags/Yices-$pkgver/yices2-$pkgver.tar.gz"
builddir="$srcdir/yices2-Yices-$pkgver"

prepare() {
	default_prepare
	NOCONFIGURE=1 autoreconf -vfi
}

build() {
	CFLAGS="$CFLAGS -O2 -flto=auto" \
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-thread-safety
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	rm "$pkgdir"/usr/lib/*.a
}

sha512sums="
d8102c41fda0e200fd1336ae317b516d2797d10c187b8f7aecf0c9b08b4b487b90bef8c358099b2da51c0367326939f9610fd4e6d5a41a392cf1114bd04b8763  yices2-2.6.4.tar.gz
"
